import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Login',
    component: () => import('../views/Login.vue')
  },
  {
    path: '/Main',
    name: 'Main',
    component: () => import('../views/Main.vue'),
    redirect:'/PersonStore',
    children:[
      {
        path:'/PersonStore',
        name:'PersonStore',
        component:()=>import('../components/PersonStore.vue')
      },
      {
        path:'/PersonDingdan',
        name:'PersonDingdan',
        component:()=>import('../components/PersonDingdan.vue')
      }, 
      {
        path:'/PersonFinish',
        name:'PersonFinish',
        component:()=>import('../components/PersonFinish.vue')
      }
    ]
  },
  {
    path: '/Kucun',
    name: 'index',
    component: () => import('../views/index.vue'),
    redirect: '/Kucun',
    children: [
      {
        path: '/Kucun',
        name: 'Kucun',
        component: () => import('../components/Kucun.vue')
      },
      {
        path: '/Dingdan',
        name: 'Dingdan',
        component: () => import('../components/Dingdan.vue')
      },
      {
        path: '/Keshihua',
        name: 'Keshihua',
        component: () => import('../components/Keshihua.vue')
      },
    ]
  },
  {
    path: '/person',
    name: 'person',
    component: () => import('../components/Person.vue')
  }
]

const router = new VueRouter({
  routes
})

export default router
